<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:27:"./public/user/register.html";i:1541126931;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<link rel="stylesheet" href="/public/static/css/user.css" />
<link rel="stylesheet" href="/public/static/plug/layui/css/layui.css">
<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="/public/static/js/common/base64.js"></script>
<script src="/public/static/js/common/json.js"></script>
<script src="/public/static/js/common/md5.js"></script>
<script src="/public/static/js/common/sign.js"></script>
<script language="javascript" src="/public/static/js/user/url.js"></script>

<body>
<div class="lg-container">
    <h1>Register</h1>
    <form action="#" id="lg-form" name="lg-form" method="post">

        <div>
            <label for="username">Username:</label>
            <input type="text" name="username" id="username" placeholder="username"/>
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" name="password" id="password" placeholder="password" />
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" name="password_confirm" id="password_confirm" placeholder="set password" />
        </div>

        <div>
            <label for="password">Phone:</label>
            <input type="text" name="phone" id="phone" placeholder="phone" />
        </div>

        <div align="center">
            <button type="button" id="register" style="margin-right: 40px">Register</button>
            <button type="button" onclick="history.go(-1)">Reback</button>
        </div>

    </form>
    <div id="message"></div>
</div>

</body>
<!--页面标签-->
<!--<script>
    $(document).ready(function(){
        $("#login").click(function(){

            var action = $("#lg-form").attr('action');
            var form_data = {
                username: $("#username").val(),
                password: $("#password").val(),
                is_ajax: 1
            };

            $.ajax({
                type: "POST",
                url: action,
                data: form_data,
                success: function(response)
                {
                    if(response == "200")
                        $("#lg-form").slideUp('slow', function(){
                            $("#message").html('<p class="success">You have logged in successfully!</p><p>Redirecting....</p>');
                        });
                    else{
//                        $("#message").html('<p class="error">ERROR: Invalid username and/or password.</p>');
                    }

                }
            });
            return false;
        });
    });
</script>-->

<!--ajax 登录-->
<script language="javascript" src="/public/static/js/user/user_login.js"></script>
<script src="/public/static/plug/layui/layui.js"></script>
<script>
    $(function () {
        $('#register').click(function () {
            var username = $('#username').val();
            var password = $('#password').val();
            var password_confirm = $('#password_confirm').val();
            var phone = $('#phone').val();
            layui.use(['layer', 'form'], function() {
                /*if (password != pass) {
                    layer.msg('两次输入密码不一致', {icon: 2});
                }
                else if (password == '' || pass == '') {
                    layer.msg('密码不能为空', {icon: 2});
                }
                else if (phone == '') {
                    layer.msg('手机号码不能为空', {icon: 2});
                }
                else {*/
                    userRegister(username, password, password_confirm,phone);
//                }
            })
        })
    })
</script>

</html>